import { EntityTypeEnum, InputTypeEnum } from "./Enum"

export interface IVec3 {
    x: number
    y: number
    z: number
}


export interface IActor {
    id: number,
    hp: number,
    nickname:string;//昵称
    position: IVec3
    direction: IVec3
    type:EntityTypeEnum//类型
    weaponType:EntityTypeEnum
    bulletType:EntityTypeEnum
}
// 子弹
export interface IBullet{
    id: number,
    owner: number,
    position: IVec3
    direction: IVec3
    type:EntityTypeEnum//类型
}
//游戏状态
export interface IState {
    actor: IActor[];
    bullet: IBullet[];
    nextBulletId: number;
}

export type IClientInput = IActorMove | IWeaponShoot | ITimePast;
//移动状态
export interface IActorMove {
    id: number,
    type: InputTypeEnum.ActorMove,//输入类型
    direction: IVec3,//输入方向
    dt:number,
}

export interface IWeaponShoot {
    type: InputTypeEnum.WeaponShoot,//输入类型
    owner: number,
    position: IVec3,
    direction: IVec3,
}
// 时间
export interface ITimePast {
    type: InputTypeEnum.TimePast,
    dt: number,
}


